package com.jd.common;

/**
 * Created by Administrator on 2017/9/21/021.
 */
public class DataGridReq {
    /**
     * 当前页面
     */
    private Integer page;
    /**
     * 每页记录数量
     */
    private Integer rows;
    /**
     * 排序的字段
     */
    private String sort;
    /**
     * 排序方式
     */
    private String order;
    /**
     * 偏移量，即其实条数
     */
    private Integer offest;

    public Integer getOffest() {
        return (this.page - 1) * this.rows;
    }

    public void setOffest(Integer offest) {
        this.offest = offest;

    }

    public Integer getPage() {
        return page;
    }

    public void setPage(Integer page) {
        this.page = page;
    }

    public Integer getRows() {
        return rows;
    }

    public void setRows(Integer rows) {
        this.rows = rows;
    }

    public String getSort() {
        return sort;
    }

    public void setSort(String sort) {
        this.sort = sort;
    }

    public String getOrder() {
        return order;
    }

    public void setOrder(String order) {
        this.order = order;
    }

    public DataGridReq() {

    }

    public DataGridReq(Integer page, Integer rows, String sort, String order, Integer offest) {
        this.page = page;
        this.rows = rows;
        this.sort = sort;
        this.order = order;
        this.offest = offest;
    }

    @Override
    public String toString() {
        return "DataGridReq{" +
                "page=" + page +
                ", rows=" + rows +
                ", sort='" + sort + '\'' +
                ", order='" + order + '\'' +
                ", offest=" + offest +
                '}';
    }
}
